import {BASE_URL} from '@/services/api'
import {METHOD, request} from '@/utils/request'

export async function query${entity}(payload) {
    return request(`${r'${BASE_URL}'}/${lowerEntityName}/query${entity}`, METHOD.GET, payload)
}

export async function add${entity}(payload) {
    return request(`${r'${BASE_URL}'}/${lowerEntityName}/add${entity}`, METHOD.POST, payload)
}

export async function update${entity}(payload) {
    let {objectId} = payload
    return request(`${r'${BASE_URL}'}/${lowerEntityName}/update${entity}/${r'${objectId}'}`, METHOD.PATCH, payload)
}

export async function delete${entity}(payload) {
    return request(`${r'${BASE_URL}'}/${lowerEntityName}/delete${entity}/${r'${payload}'}`, METHOD.DELETE)
}